package cn.edu.scau.cmi.linzhiyang.composite.safe;

public class Main {

	public static void main(String[] args) {
		Organization composite = new Organization("root");
		Component com = null;
		com = new Member("张三");
		composite.addMember(com);
		com = new Organization("人资部");
		composite.addMember(com);
		System.out.println(composite.getMembers());
		
		if(com instanceof Organization) {
			System.out.println("yes");
		}
	}
}
